package com.dimples.dd.system.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.dimples.dd.common.pojo.PageResult;
import com.dimples.dd.system.model.entity.SystemGatewayRouteDO;
import com.dimples.dd.system.model.form.GatewayRouteForm;
import com.dimples.dd.system.model.query.GatewayRoutePageQuery;
import com.dimples.dd.system.model.vo.GatewayRoutePageVO;

public interface SystemGatewayRouteService extends IService<SystemGatewayRouteDO> {

    /**
     * 添加所有的路由信息到redis
     *
     * @param key redis key
     */
    void addRoute2Redis(String key);

    /**
     * 清空redis中的route信息
     */
    void clearRedis();

    /**
     * 创建路由
     *
     * @param gatewayRouteForm 路由表单
     * @return Long
     */
    Long createGatewayRoute(GatewayRouteForm gatewayRouteForm);

    /**
     * 更新路由
     *
     * @param gatewayRouteForm 路由表单
     */
    void updateGatewayRoute(GatewayRouteForm gatewayRouteForm);

    /**
     * 删除路由
     *
     * @param id 路由id
     */
    void deleteGatewayRoute(Long id);

    /**
     * 根据id查询路由
     *
     * @param id 路由id
     * @return GatewayRouteForm
     */
    GatewayRouteForm selectGatewayRoute(Long id);

    /**
     * 分页查询路由
     *
     * @param pageQuery 分页查询参数
     * @return PageResult<GatewayRoutePageVO>
     */
    PageResult<GatewayRoutePageVO> selectGatewayRoutePage(GatewayRoutePageQuery pageQuery);
}
